package elitech.vietnam.myfashion.view;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.GridView;
import android.widget.LinearLayout;

import com.handmark.pulltorefresh.library.PullToRefreshBase.Mode;
import com.handmark.pulltorefresh.library.PullToRefreshGridView;

import elitech.vietnam.myfashion.MainActivity;
import elitech.vietnam.myfashion.R;
import elitech.vietnam.myfashion.entites.Product;
import elitech.vietnam.myfashion.extend.GridViewArrayAdapter;

public class BestOfWeekView extends LinearLayout {
	private MainActivity mContext;
	private PullToRefreshGridView mPullRefreshGridView;
	private GridView mGridView;
	private GridViewArrayAdapter mAdapter;
	private ArrayList<Product> mListProduct = new ArrayList<Product>();

	public BestOfWeekView(MainActivity context) {
		super(context);
		this.mContext = context;
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		if (inflater != null) {
			inflater.inflate(R.layout.bestofweek, this);
		}

		mPullRefreshGridView = (PullToRefreshGridView) this
				.findViewById(R.id.bow_gridview);
		mGridView = mPullRefreshGridView.getRefreshableView();
		
		mPullRefreshGridView.setMode(Mode.DISABLED);
		
		mAdapter = new GridViewArrayAdapter(context, R.id.bow_gridview, 0, mListProduct, false);
		
		mGridView.setAdapter(mAdapter);
	}
}
